<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/common/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<link href="${ctx}resources/css/select/bootstrap-select.css" rel="stylesheet" type="text/css">
<%@ include file="/WEB-INF/common/head.jsp"%>
</head>
<body class="${cookie.bodyClass.value}">
	<div class="container body">
		<div class="main_container">
			<%@ include file="/WEB-INF/common/left.jsp"%>
			<%@ include file="/WEB-INF/common/top.jsp"%>
			<!-- page content -->
			<div class="right_col" role="main" id="main">
				<div class="x_panel">
					<div class="x_title">
						<h2>提现详情</h2>
						<div class="clearfix"></div>
					</div>
					<div class="x_content">
						<div class="modal-body">
							<form role="form" data-parsley-validate id="withdrawalsForm" class="form-horizontal">
								<input id="withdrawalsId" name="withdrawalsId" type="hidden" value="${withdrawals.withdrawalsId}" />
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">提现人电话:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="cellphone" name="cellphone" value="${withdrawals.cellphone}" disabled="disabled">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">提现人昵称:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="nickName" name="nickName" value="${withdrawals.nickName}" disabled="disabled">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">提现手续费:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="brokerage" name="brokerage" value="${withdrawals.brokerage}" disabled="disabled">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">实际打款金额:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="payMoney" name="payMoney" value="${withdrawals.payMoney}" disabled="disabled">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">状态:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<c:if test="${withdrawals.status==0}">
										<input type="text" class="form-control" id="status" name="status" value="待审核" disabled="disabled">
										</c:if>
										<c:if test="${withdrawals.status==1}">
										<input type="text" class="form-control" id="status" name="status" value="已打款" disabled="disabled">
										</c:if>
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">提现银行:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="bankName" name="bankName" value="${withdrawals.bankName}" disabled="disabled">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">银行所属支行:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="bankBranch" name="bankBranch" value="${withdrawals.bankBranch}" disabled="disabled">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">银行预留姓名:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="reservedName" name="reservedName" value="${withdrawals.reservedName}" disabled="disabled">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">银行卡号:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="bankCardNumber" name="bankCardNumber" value="${withdrawals.bankCardNumber}" disabled="disabled">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">提现申请时间:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="createDate" name="createDate" value="${withdrawals.createDate}" disabled="disabled">
									</div>
								</div>
								 
							</form>
						</div>
						<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="text-align:center">
							<button type="button" class="btn btn-dark btn-sm" onclick="back();">返回</button>
							<c:if test="${withdrawals.status==0 }">
							<button type="button" class="btn btn-primary btn-sm" onclick="audit();">审核</button>
							</c:if>
						</div>
					</div>
				</div>
			</div>
			<!-- /page content -->
			<%@ include file="/WEB-INF/common/foot.jsp"%>
		</div>
	</div>
	<%@ include file="/WEB-INF/common/script.jsp"%>
	<script type="text/javascript" src="${ctx}resources/js/ajaxfileupload.js"></script>
	<script src="${ctx}resources/js/select/bootstrap-select.js"></script>
	<script type="text/javascript">
		$(function() {});
		function back() {
			window.location = ctx + "admin/withdrawals/toWithdrawalsPage";
		}

		function audit() {
			$.ajax({
				url : ctx + "admin/withdrawals/audit",
				dataType : "json",
				data : {
					withdrawalsId:$("#withdrawalsId").val()
				},
				success : function(result) {
					if (result.status == "0") {
						swal({
							title : '',
							text : "审核成功"
						}, function() {
							back();
						});
					} else {
						swal({
							title : '',
							text : result.msg,
							type : "error"
						});
					}
				}
			});
		}
	</script>
</body>
</html>